home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 4 / ETO Development Tools 4.iso / Essentials / MacApp Documentation / MacApp.TECH$ Archives / 1990 / Dec 90 / MacApp.Tech$ 12⁄7⁄90 / 2454-C++ oddity-Dec90 < prev    next >
Encoding:
Text File  |  1991-03-06  |  927 b   |  38 lines  |  [TEXT/GEOL]

  1. Item    2135956                         4-Dec-90        16:54PST
  2.  
  3. From:   X2228                           Lowell Schneider Cns,LSchneider,ACR
  4.  
  5. To:     MACAPP.TECH$                    MacApp Technical
  6.  
  7. Sub:    C++ oddity
  8.  
  9. I wrote the following lines of code in C++.  The routine draw_fkey() conforms
  10. to that which is required by the Each() method of TList.
  11.  
  12. If you look in routine draw_fkey(), you see that parameter 'arg' is cast into
  13. TDBKey!  Not 'item' as is proper.  Parameter 'arg' should be NULL.
  14.  
  15. I found this "solution" after hours of frustrating debugging.  Any clues?
  16. Hints?  I HAVE been able to use Each() in other situations successfully, so I
  17. am really baffled.
  18.  
  19. Thanks, Lowell
  20. LSC
  21.  
  22.  
  23. class TDBTable : public TDBObject {
  24.     ...
  25.     TList *fkey;
  26. }
  27.  
  28. pascal void draw_fkey (TObject *item, void *arg)
  29. {
  30.    ((TDBKey*)arg) -> draw ();
  31. }
  32.  
  33. void TDBTable::draw_fkeys (void)
  34. {
  35.    fkey->Each (draw_fkey, NULL);
  36. }
  37.  
  38.